import 'package:getx_demo/common/values/values.dart';
import '../utils/utils.dart';

/// 用户相关请求
abstract class UserRequest {
  /// 登录接口
  static Future<APIResponse?> login({
    required String username,
    required String password,
  }) async {
    final param = {
      'username': username,
      'password': password,
    };
    return await httpUtil.call(
      method: DioMethod.post,
      path: APIPath.login,
      data: param,
    );
  }

  static Future<APIResponse?> getUserInfo() async {
    return await httpUtil.call(method: DioMethod.get, path: APIPath.userInfo);
  }

  static Future<APIResponse?> getUserBaseInfo() async {
    return await httpUtil.call(method: DioMethod.get, path: APIPath.myMessage);
  }
}
